<div class="ui-g">
    <div class="ui-g-2 border-spe-right">
        <p-tree [value]="procActTree" selectionMode="single" (onNodeSelect)="nodeSelect($event)"
            [filter]="true" filterMode="strict" [(selection)]="selectedNode" emptyMessage="无数据" [loading]="loading"
            [style]="{'height': 'calc(100% - 75px)','width':'100%','border-style':'none', 'padding':0}">
        </p-tree>
    </div>
    <div class="ui-g-10">
        <div class="button-item">
            <button pButton type="text" class="ui-button-success" icon="fa fa-check" (click)="saveUpdate($event)"
                label="保存"></button>
        </div>
        <div class="container">
            <p-table [value]="partMenus" [scrollable]="true" [scrollHeight]="scrollHeight" frozenWidth="200px">
                <ng-template pTemplate="frozenheader">
                    <tr><th>&nbsp;</th></tr>
                    <tr><th style="text-align: center;">环节参与人</th></tr>
                    <tr><th style="height:40px;">&nbsp;</th></tr>
                </ng-template>
                <ng-template pTemplate="frozenbody" let-part>
                    <tr style="height:40px;">
                        <td style="width:60px;white-space:nowrap;">
                            <ng-container *ngIf="part.partType == 'H'">人员</ng-container>
                            <ng-container *ngIf="part.partType == 'U'">机构</ng-container>
                            <ng-container *ngIf="part.partType == 'R'">岗位</ng-container>
                        </td>
                        <td style="white-space: nowrap">{{part.partName}}</td>
                    </tr>
                </ng-template>
                <ng-template pTemplate="header">
                    <tr>
                        <th *ngFor="let col of cols" [ngStyle]="{ 'width': col.width, 'text-align': 'center' }"
                            [attr.colspan]="col.children.length">{{col.header}}</th>
                    </tr>
                    <tr>
                        <ng-container *ngFor="let col of cols">
                            <th *ngFor="let child of col.children" style="text-align: center;">{{child.header}}</th>
                        </ng-container>
                    </tr>
                    <tr style="height:40px;">
                        <ng-container *ngFor="let col of cols">
                            <th *ngFor="let child of col.children" style="width:100px;text-align: center">
                                <p-checkbox binary="true" (click)="checkAllPart(child)" id='menu_{{child.id}}'></p-checkbox>
                            </th>
                        </ng-container>
                    </tr>
                </ng-template>
                <ng-template pTemplate="body" let-rowData>
                    <tr style="height:40px;">
                        <ng-container *ngFor="let col of cols">
                            <td *ngFor="let child of col.children" style="width:100px;text-align: center">
                                <p-checkbox binary="true" [(ngModel)]="rowData.auths[child.id]">
                                </p-checkbox>
                            </td>
                        </ng-container>
                    </tr>
                </ng-template>
            </p-table>
        </div>
    </div>
</div>